package com.ilancuo.cnbeta;

public class Smali2JavaTest {

    private static final String PARAM = "&mpuffgvbvbttn3Rc";

    public static void main(String[] args) {
        System.out.println(getNewsList());
    }

    /**
     * 获取文章列表
     */
    public static String getNewsList() {
        StringBuilder localStringBuilder = new StringBuilder();
        localStringBuilder.append("app_key=").append("10000");
        localStringBuilder.append("&format=").append("json");
        localStringBuilder.append("&method=").append("Article.Lists");
        localStringBuilder.append("&timestamp=").append(System.currentTimeMillis());
        localStringBuilder.append("&v=").append("1.0");
        String str = SignUtil.getSign(localStringBuilder.toString() + PARAM);
        localStringBuilder.append("&sign=").append(str);
        localStringBuilder.insert(0, "http://api.cnbeta.com/capi?");
        return localStringBuilder.toString();
    }

    /**
     * 获取文章内容
     */
    public static String getNewsContent() {
        StringBuilder localStringBuilder = new StringBuilder();
        localStringBuilder.append("app_key=").append("10000");
        localStringBuilder.append("&format=").append("json");
        localStringBuilder.append("&method=").append("Article.NewsContent");
        localStringBuilder.append("&sid=").append("603127");
        localStringBuilder.append("&timestamp=").append(System.currentTimeMillis());
        String str = SignUtil.getSign(localStringBuilder.toString() + PARAM);
        localStringBuilder.append("&sign=").append(str);
        localStringBuilder.insert(0, "http://api.cnbeta.com/capi?");
        return localStringBuilder.toString();
    }

    /**
     * 获取今日推荐
     */
    public static String getTodayRank() {
        StringBuilder localStringBuilder = new StringBuilder();
        localStringBuilder.append("app_key=").append("10000");
        localStringBuilder.append("&format=").append("json");
        localStringBuilder.append("&method=").append("Article.TodayRank");
        localStringBuilder.append("&timestamp=").append(System.currentTimeMillis());
        localStringBuilder.append("&type=").append("comments");
        localStringBuilder.append("&v=").append("1.0");
        String str = SignUtil.getSign(localStringBuilder.toString() + PARAM);
        localStringBuilder.append("&sign=").append(str);
        localStringBuilder.insert(0, "http://api.cnbeta.com/capi?");
        return localStringBuilder.toString();
    }

    /**
     * 获取文章主题
     */
    public static String getNavList() {
        StringBuilder sb = new StringBuilder();
        sb.append("app_key=").append("10000");
        sb.append("&format=").append("json");
        sb.append("&method=").append("Article.NavList");
        sb.append("&timestamp=").append(System.currentTimeMillis());
        sb.append("&v=").append("1.0");
        String str = SignUtil.getSign(sb.toString() + PARAM);
        sb.append("&sign=").append(str);
        sb.insert(0, "http://api.cnbeta.com/capi?");
        return sb.toString();
    }

    /**
     * 获取本月Top10
     */
    public static String getTop10Article() {
        StringBuilder sb = new StringBuilder();
        sb.append("app_key=").append("10000");
        sb.append("&format=").append("json");
        sb.append("&method=").append("Article.Top10");
        sb.append("&timestamp=").append(System.currentTimeMillis());
        sb.append("&v=").append("1.0");
        String str = SignUtil.getSign(sb.toString() + PARAM);
        sb.append("&sign=").append(str);
        sb.insert(0, "http://api.cnbeta.com/capi?");
        return sb.toString();
    }


}
